#include<iostream>
#include<cstring>
using namespace std;
const int N = 110;
int a[N], b[N];
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		bool flag = 0;
		memset(a, 0, sizeof(a));
		memset(b, 0, sizeof(b));
		for (int i = 1; i <= n; i++) {
			cin >> b[i];
			b[i]++;	
			a[b[i]]++;
		}
		for (int i = 2; i < 110; i++) {
			if (a[i] > a[i - 1]) {
				flag = 1;
			}
		}
		if (flag)cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0;
}